import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import * as api from '@/api/requests.js'
// 导入UI库
import element from '@/config/element'
import 'element-ui/lib/theme-chalk/index.css'
// 导入图片懒加载
import VueLazyload from 'vue-lazyload'
// 全局注册header和footer组件
import Header from './components/header'
import Footer from './components/footer'
import Introduce from './components/introduce'
import productHeader from './components/productHeader/index.vue'
import orderHeader from './components/order-header/index.vue'

Vue.use(element)
Vue.use(VueLazyload, {
  loading: '/imgs/loading-svg/loading-bars.svg'
})
Vue.config.productionTip = false
Vue.component(Header.name, Header)
Vue.component(Footer.name, Footer)
Vue.component(Introduce.name, Introduce)
Vue.component(productHeader.name, productHeader)
Vue.component(orderHeader.name, orderHeader)
new Vue({
  router,
  store,
  beforeCreate() {
    Vue.prototype.$API = api
  },
  render: h => h(App)
}).$mount('#app')
